package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

/*
 *  @author SHCJ
 *  @created 2025/10/6 13:22
 *  @description
 */
@Mapper
public interface RoleMapper {

    List<Role> selectPage(String name, String label);

    @Delete("delete  from role where id=#{id}")
    void delete(Integer id);

//    @Insert("insert into role(name,label,remark) values(#{name},#{label},#{remark}")
    @Insert("insert into role(name,label,remark,create_time,update_time) values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role role);

    @Select("select * from role where id=#{id}")
    Role selectById(Integer id);

    @Update("update role set name=#{name},label=#{label},remark=#{remark},update_time=#{updateTime} where id=#{id}")
    void update(Role role);

    @Select("select * from role")
    List<Role> selectAll();
}
